//
//  HNSH_InviteFriendsBottomView.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2023/2/28.
//

#import "HNSH_InviteFriendsBottomView.h"

@implementation HNSH_InviteFriendsBottomView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor appBGColor];
        [self addAllViews];
        [self addAllLayout];
    }
    return self;
}

//MARK: Myself Methods
- (void)addAllViews{
    NSArray *titles = @[@"下载",@"分享好友",@"朋友圈"];
    NSArray *images = @[@"mine_share_download",@"mine_share_share_icon",@"mine_share_pyq"];
    for (int i = 0; i < titles.count; i ++) {
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        button.frame = CGRectMake(kScreenWidth/3 * i, 8, kScreenWidth/3, 61);
        [button setTitle:titles[i] forState:UIControlStateNormal];
        [button setTitleColor:[UIColor appBlackLabelColor] forState:UIControlStateNormal];
        button.titleLabel.font = [UIFont boldSystemFontOfSize:12];
        [button setImage:[UIImage imageNamed:images[i]] forState:UIControlStateNormal];
        [self addSubview:button];
        [button HNSH_layoutButtonWithEdgeInsetsStyle:HHZXButtonStyleTextBottom imageTitleSpace:6];
        button.tag = i;
        WeakSelf(weakSelf);
        [[button rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
            UIButton *selectButton = x;
            if (weakSelf.clickBlock) {
                weakSelf.clickBlock(selectButton.tag);
            }
        }];
    }
}

- (void)addAllLayout{
    
}



@end
